!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(e){return e.find("> li > :first-child").add(e.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=o(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():o()}},_createIcons:function(){var e,t=this.options.icons;t&&(e=o(""),this._addClass(e,"ui-accordion-header-icon","ui-icon "+t.header),e.prependTo(this.headers),e=this.active.children(".ui-accordion-header-icon"),this._removeClass(e,t.header)._addClass(e,null,t.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"===e?this._activate(t):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t)&&this._createIcons())},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=o.ui.keyCode,i=this.headers.length,a=this.headers.index(e.target),s=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:s=this.headers[(a+1)%i];break;case t.LEFT:case t.UP:s=this.headers[(a-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:s=this.headers[0];break;case t.END:s=this.headers[i-1]}s&&(o(e.target).attr("tabIndex",-1),o(s).attr("tabIndex",0),o(s).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===o.ui.keyCode.UP&&e.ctrlKey&&o(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=o()):!1===e.active?this._activate(0):this.active.length&&!o.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=o()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var i,e=this.options,t=e.heightStyle,a=this.element.parent();this.active=this._findActive(e.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=o(this),t=e.uniqueId().attr("id"),i=e.next(),a=i.uniqueId().attr("id");e.attr("aria-controls",a),i.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(i=a.height(),this.element.siblings(":visible").each(function(){var e=o(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=o(this).outerHeight(!0)}),this.headers.next().each(function(){o(this).height(Math.max(0,i-o(this).innerHeight()+o(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.headers.next().each(function(){var e=o(this).is(":visible");e||o(this).show(),i=Math.max(i,o(this).css("height","").height()),e||o(this).hide()}).height(i))},_activate:function(e){e=this._findActive(e)[0];e!==this.active[0]&&(e=e||this.active[0],this._eventHandler({target:e,currentTarget:e,preventDefault:o.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):o()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&o.each(e.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,i=this.active,a=o(e.currentTarget),s=a[0]===i[0],n=s&&t.collapsible,h=n?o():a.next(),r=i.next(),r={oldHeader:i,oldPanel:r,newHeader:n?o():a,newPanel:h};e.preventDefault(),s&&!t.collapsible||!1===this._trigger("beforeActivate",e,r)||(t.active=!n&&this.headers.index(a),this.active=s?o():a,this._toggle(r),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),t.icons&&(h=i.children(".ui-accordion-header-icon"),this._removeClass(h,null,t.icons.activeHeader)._addClass(h,null,t.icons.header)),s)||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),t.icons&&(e=a.children(".ui-accordion-header-icon"),this._removeClass(e,null,t.icons.header)._addClass(e,null,t.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active"))},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=i,this.options.animate?this._animate(t,i,e):(i.hide(),t.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(o(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){function a(){n._toggleComplete(t)}var s,n=this,h=0,r=e.css("box-sizing"),o=e.length&&(!i.length||e.index()Previous',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a(''); msgEl.append(closeBtn); closeBtn.click(function(){ msgEl.slideUp(g_ptsAnimationSpeed, function(){ msgEl.html(''); }); return false; }); } if(res.error){ if(msgEl){ jQuery(msgEl) .removeClass(params.successClass) .addClass(params.errorClass); } var errorsArr=[]; for(var name in res.errors){ if(sentFromForm){ var inputError=jQuery(form).find('[name*="'+ name+ '"]'); inputError.addClass('ptsInputError'); if(inputError.attr('placeholder')){ } if(!inputError.data('keyup-error-remove-binded')){ inputError.keydown(function(){ jQuery(this).removeClass('ptsInputError'); }).data('keyup-error-remove-binded', 1); }} if(jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').exists()) jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').show().html(res.errors[name]); else if(msgEl) jQuery(msgEl).append(res.errors[name]).append('
'); else errorsArr.push(res.errors[name]); } if(errorsArr.length&¶ms.btn&&jQuery.fn.dialog){ jQuery('
').html(errorsArr.join('
')).appendTo('body').dialog({ modal: true , width: '500px' , classes: { "ui-dialog": "ptsCreateTableModal" } , dialogClass: 'ptsCreateTableModal', }); }}else if(res.messages.length){ if(msgEl){ jQuery(msgEl) .removeClass(params.errorClass) .addClass(params.successClass); for(var i=0; i < res.messages.length; i++){ jQuery(msgEl).append(res.messages[i]).append('
'); }} }} if(params.onSuccess&&typeof(params.onSuccess)=='function'){ params.onSuccess(res); }} function getDialogElementPts(){ return jQuery('
').appendTo(jQuery('body')); } function toeOptionPts(key){ if(PTS_DATA.options&&PTS_DATA.options[ key ]) return PTS_DATA.options[ key ]; return false; } function toeLangPts(key){ if(PTS_DATA.siteLang&&PTS_DATA.siteLang[key]) return PTS_DATA.siteLang[key]; return key; } function toePagesPts(key){ if(typeof(PTS_DATA)!='undefined'&&PTS_DATA[key]) return PTS_DATA[key]; return false;; } function toeOptTimeoutHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); setTimeout(function(){ if(!jQuery('#ptsOptDescription').attr('toeFixTip')) toeOptHideDescriptionPts(); }, 500); } function toeOptShowDescriptionPts(description, x, y, moveToLeft){ if(typeof(description)!='undefined'&&description!=''){ if(!jQuery('#ptsOptDescription').size()){ jQuery('body').append('
'); } if(moveToLeft) jQuery('#ptsOptDescription').css('right', jQuery(window).width() - (x - 10)); else jQuery('#ptsOptDescription').css('left', x + 10); jQuery('#ptsOptDescription').css('top', y); jQuery('#ptsOptDescription').show(200); jQuery('#ptsOptDescription').html(description); }} function toeOptHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); jQuery('#ptsOptDescription').hide(200); } function toeInArrayPts(needle, haystack){ if(haystack){ for(var i in haystack){ if(haystack[i]==needle) return true; }} return false; } function toeShowDialogCustomized(element, options){ options=jQuery.extend({ resizable: false , width: 500 , height: 300 , closeOnEscape: true , open: function(event, ui){ jQuery('.ui-dialog-titlebar').css({ 'background-color': '#222222' , 'background-image': 'none' , 'border': 'none' , 'margin': '0' , 'padding': '0' , 'border-radius': '0' , 'color': '#CFCFCF' , 'height': '27px' }); jQuery('.ui-dialog-titlebar-close').css({ 'background': 'url("'+ PTS_DATA.cssPath+ 'img/tb-close.png") no-repeat scroll 0 0 transparent' , 'border': '0' , 'width': '15px' , 'height': '15px' , 'padding': '0' , 'border-radius': '0' , 'margin': '7px 7px 0' }).html(''); jQuery('.ui-dialog').css({ 'border-radius': '3px' , 'background-color': '#FFFFFF' , 'background-image': 'none' , 'padding': '1px' , 'z-index': '300000' , 'position': 'fixed' , 'top': '60px' }); jQuery('.ui-dialog-buttonpane').css({ 'background-color': '#FFFFFF' }); jQuery('.ui-dialog-title').css({ 'color': '#CFCFCF' , 'font': '12px sans-serif' , 'padding': '6px 10px 0' }); if(options.openCallback&&typeof(options.openCallback)=='function'){ options.openCallback(event, ui); } jQuery('.ui-widget-overlay').css({ 'z-index': jQuery(event.target).parents('.ui-dialog:first').css('z-index') - 1 , 'background-image': 'none' }); if(options.modal&&options.closeOnBg){ jQuery('.ui-widget-overlay').unbind('click').bind('click', function(){ jQuery(element).dialog('close'); }); }} }, options); return jQuery(element).dialog(options); } function toeSliderMove(event, ui){ var id=jQuery(event.target).attr('id'); jQuery('#toeSliderDisplay_'+ id).html(ui.value); jQuery('#toeSliderInput_'+ id).val(ui.value).change(); } function extendPts(Child, Parent){ var F=function(){ }; F.prototype=Parent.prototype; Child.prototype=new F(); Child.prototype.constructor=Child; Child.superclass=Parent.prototype; }; ;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('
');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K='
'+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("
").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document); (function($){ $.fn.responsiveText=function(options){ var settings=$.extend({ 'minFontSize':Number.NEGATIVE_INFINITY, 'maxFontSize':Number.POSITIVE_INFINITY }, options); return this.each(function(){ var $this=$(this), text=$this.get(0); if(!text) return; $this.data('original-font-size', parseFloat( window.getComputedStyle(text).fontSize ), 10); var resizer=function (){ var ratio=null, originalWidth=window.screen.availWidth, currentWidth=window.innerWidth, size=$this.data('original-font-size'); if(originalWidth==currentWidth||!size) return; if(currentWidth!=originalWidth) ratio=originalWidth / currentWidth; if(currentWidth > originalWidth) size *=ratio; else size /=ratio; size=Math.max(Math.min(size, settings.maxFontSize ), settings.minFontSize ); $this.css('font-size', size + 'px'); }; resizer(); $(window).on('resize.responsiveText orientationchange.responsiveText', resizer); }); };})(jQuery); function ptsBlockFabric(){ this._blocks=[]; this._isSorting=false; this._animationSpeed=g_ptsAnimationSpeed; } ptsBlockFabric.prototype.addFromHtml=function(blockData, jqueryHtml){ var block=this.add(blockData); block.setRaw(jqueryHtml); }; ptsBlockFabric.prototype.add=function(blockData){ var blockData=jQuery.extend({}, blockData); if(!blockData.original_id){ blockData.original_id=blockData.id; blockData.id=0; } var blockClass=window[ 'ptsBlock_'+ blockData.cat_code ]; if(blockClass){ var block=new blockClass(blockData); var blockIter=this._blocks.push(block); block.setIter(blockIter - 1); return block; }else{ console.log('Block Class For '+ blockData.cat_code+ ' Not Found!!!'); }}; ptsBlockFabric.prototype.getByViewId=function(viewId){ if(this._blocks&&this._blocks.length){ for(var i=0; i < this._blocks.length; i++){ if(this._blocks[ i ].get('view_id')==viewId){ return this._blocks[ i ]; }} } return false; }; function ptsBlockBase(blockData){ this._data=blockData; this._$=null; this._original$=null; this._id=0; this._iter=0; this._elements=[]; this._animationSpeed=300; this._disableContentChange=false; } ptsBlockBase.prototype.get=function(key){ return this._data[ key ]; }; ptsBlockBase.prototype.getParam=function(key){ return this._data.params[ key ] ? this._data.params[ key ].val:false; }; ptsBlockBase.prototype.setParam=function(key, value){ if(!this._data.params[ key ]) this._data.params[ key ]={}; this._data.params[ key ].val=value; }; ptsBlockBase.prototype.getRaw=function(){ return this._$; }; ptsBlockBase.prototype.$=function(){ return this.getRaw(); }; ptsBlockBase.prototype.setRaw=function(jqueryHtml){ this._$=jqueryHtml; this._resetElements(); this._initHtml(); if(this.getParam('font_family')){ this._setFont(this.getParam('font_family')); }}; ptsBlockBase.prototype._initElements=function(){ this._initElementsForArea(this._$); }; ptsBlockBase.prototype._initElementsForArea=function(area){ var block=this , addedElements=[]; var initElement=function(htmlEl){ var elementCode=jQuery(htmlEl).data('el') , elementClass=window[ 'ptsElement_'+ elementCode ]; if(elementClass){ var newElement=new elementClass(jQuery(htmlEl), block); newElement._setCode(elementCode); var newIterNum=block._elements.push(newElement); addedElements.push(newElement); newElement.setIterNum(newIterNum - 1); }else{ if(g_ptsEdit) console.log('Undefined Element ['+ elementCode+ '] !!!'); }}; jQuery(area).find('.ptsEl').each(function(){ initElement(this); }); if(jQuery(area).hasClass('ptsEl')){ initElement(area); } this._afterInitElements(); return addedElements; }; ptsBlockBase.prototype._afterInitElements=function(){ }; ptsBlockBase.prototype._resetElements=function(){ this._clearElements(); this._initElements(); }; ptsBlockBase.prototype._clearElements=function(){ if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].destroy(); } this._elements=[]; }}; ptsBlockBase.prototype.getElements=function(){ return this._elements; }; ptsBlockBase.prototype._initHtml=function(){ }; ptsBlockBase.prototype.setIter=function(iter){ this._iter=iter; }; ptsBlockBase.prototype.showLoader=function(txt){ var loaderHtml=jQuery('#ptsBlockLoader'); txt=txt ? txt:loaderHtml.data('base-txt'); loaderHtml.find('.ptsBlockLoaderTxt').html(txt); loaderHtml.css({ 'height': this._$.height() , 'top': this._$.offset().top }).addClass('active'); }; ptsBlockBase.prototype.hideLoader=function(){ var loaderHtml=jQuery('#ptsBlockLoader'); loaderHtml.removeClass('active'); }; ptsBlockBase.prototype._setFont=function(fontFamily){ var $fontLink=this._getFontLink(); if(toeInArrayPts(fontFamily, ptsBuildConst.standardFonts)===false){ $fontLink.attr({ 'href': 'https://fonts.googleapis.com/css?family='+ encodeURIComponent(fontFamily) }); } this._$.css({ 'font-family': fontFamily }); this.setParam('font_family', fontFamily); }; ptsBlockBase.prototype._getFontLink=function(){ var $link=this._$.find('link.ptsFont'); if(!$link.size()){ $link=jQuery('').appendTo(this._$); } return $link; }; ptsBlockBase.prototype.getElementByIterNum=function(iterNum){ return this._elements[ iterNum ]; }; ptsBlockBase.prototype.removeElementByIterNum=function(iterNum){ this._elements.splice(iterNum, 1); if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].setIterNum(i); }} }; ptsBlockBase.prototype.destroyElementByIterNum=function(iterNum, clb){ this.getElementByIterNum(iterNum).destroy(clb); }; function ptsBlock_price_table(blockData){ this._increaseHoverFontPerc=20; this._$lastHoveredCol=null; this._refreshColsBinded=false; this._onloadHandle=false; this._isAlreadyShowed=false; this._isResponsiveDescInit=false; ptsBlock_price_table.superclass.constructor.apply(this, arguments); } extendPts(ptsBlock_price_table, ptsBlockBase); ptsBlock_price_table.prototype._getColsContainer=function(){ return this._$.find('.ptsColsWrapper:first'); }; ptsBlock_price_table.prototype._getCols=function(includeDescCol){ return this._getColsContainer().find('.ptsCol'+ (includeDescCol ? '':':not(.ptsTableDescCol)')); }; ptsBlock_price_table.prototype._initTooltipsForCells=function(){ if(this.getParam('disable_custom_tooltip_style')!='1'){ var $tooltipstedCells=this._$.find('.ptsCell[title], .ptsColFooter[title], .ptsColHeader[title], .ptsColDesc[title]'); if($tooltipstedCells&&$tooltipstedCells.size()){ var tooltipsterSettings={ contentAsHTML: true , interactive: true , speed: 250 , delay: 0 , animation: 'swing' , maxWidth: 450 , position: 'top' }; $tooltipstedCells.tooltipster(tooltipsterSettings); $tooltipstedCells.each(function(){ var el=jQuery(this); el.attr('data-title', el.attr('title')).removeAttr('title'); }); }} }; ptsBlock_price_table.prototype._afterInitElements=function(){ ptsBlock_price_table.superclass._afterInitElements.apply(this, arguments); if(parseInt(this.getParam('enb_hover_animation'))){ this._initHoverEffect(); } if(this.getParam('table_align')) this._$.addClass('ptsTableAlign_' + this.getParam('table_align')); if(this.getParam('text_align')) this._$.addClass('ptsAlign_' + this.getParam('text_align')); if(!this._disableContentChange){ this._refreshCellsHeight(); } if(!this._refreshColsBinded){ this._$.bind('ptsBlockContentChanged', jQuery.proxy(function(){ this._refreshCellsHeight(); }, this)); this._refreshColsBinded=true; } if(!_ptsIsEditMode()){ this._initTooltipsForCells(); var self=this , PTS_VISIBLE_SET_HEIGHT_KEY='PTS-VISIBLE-SET-HEIGHT-KEY'; this._fixResponsive(); jQuery(window).resize(function(){ if(! self._$.is(':visible')){ self._$.data(PTS_VISIBLE_SET_HEIGHT_KEY, false); }else{ self._fixResponsive(); self._refreshCellsHeight(); }}); jQuery('.ptsTableFrontedShell .ptsPreDisplayStyle').remove(); jQuery('.ptsBlock').css({ 'opacity': '1' , 'visibility': 'visible' }); jQuery(window).on('toggleChangeCellHeight', function (){ self._refreshCellsHeight(); }); jQuery(function (){ var isEnableLazyLoad=function (){ return self._$.find('img[data-lazy-src]:not(.lazyloaded)').size() > 0; }, checkedLazyLoadLib=false; if(isEnableLazyLoad()) checkedLazyLoadLib=true; document.body.addEventListener("DOMSubtreeModified", function (e){ if(checkedLazyLoadLib && e.target.nodeType==1 && e.target.nodeName=="IMG" && jQuery.contains(self._$.get(0), e.target) ){ var isLoadedImages=true; self._$.find('img[data-lazy-src]').each(function (){ var $this=jQuery(this); if(!$this.hasClass('lazyloaded')&&!$this.hasClass('lazyload')) isLoadedImages=false; }); if(isLoadedImages){ checkedLazyLoadLib=false; self._$.find('img[data-lazy-src]').on('load', function (){ self._fixResponsive(); self._refreshCellsHeight(); }); }} if(self._isAlreadyShowed||! self._$) return; if(self._$.visible()){ self._isAlreadyShowed=true; self._fixResponsive(); self._refreshCellsHeight(); }}, false); self.setCalcWidth(); }); }else{ this.columnChidrensWidthCalc(); } var self=this; if(! this._onloadHandle){ this._onloadHandle=true; jQuery(window).load(function(){ self._refreshCellsHeight(); }); }}; ptsBlock_price_table.prototype._initHoverEffect=function(){ if(_ptsIsEditMode()){ this.setParam('enb_hover_animation', 1); return; } var $cols=this._getCols() , self=this; this._disableHoverEffect($cols); $cols.bind('hover.animation', function(e){ switch(e.type){ case 'mouseenter': case 'mousein': self._increaseHoverFont(jQuery(this)); break; case 'mouseleave': case 'mouseout': self._backHoverFont(jQuery(this)); break; }}); this.setParam('enb_hover_animation', 1); }; ptsBlock_price_table.prototype._increaseHoverFont=function($col){ var self=this; if(_ptsIsEditMode()) return; var $descCell=$col.find('.ptsColDesc'); $col.height($col.height()); $descCell.find('span').each(function(){ var newFontSize=jQuery(this).data('new-font-size'); if(!newFontSize){ var prevFontSize=jQuery(this).css('font-size') , fontUnits=prevFontSize.replace(/\d+/, '') , fontSize=parseInt(str_replace(prevFontSize, fontUnits, '')); if(fontSize&&fontUnits){ newFontSize=Math.ceil(fontSize + (self._increaseHoverFontPerc * fontSize / 100)); jQuery(this) .data('prev-font-size', prevFontSize) .data('font-units', fontUnits) .data('new-font-size', newFontSize); }} if(newFontSize){ jQuery(this).css('font-size', newFontSize+ jQuery(this).data('font-units')); }}); if(this.getParam('is_horisontal_row_type')!='1'){ if(!$descCell.attr('data-prev-height')){ var descHeight=$descCell.outerHeight(); $descCell.attr('data-prev-height', descHeight); }else{ descHeight=$descCell.attr('data-prev-height'); } $descCell.css({ 'min-height': descHeight , 'height': 'auto' }); } $col.addClass('hover'); if(_ptsIsEditMode()){ setTimeout(function(){ var colElement=self.getElementByIterNum($col.data('iter-num')); if(colElement){ colElement.repositeMenu(); }}, g_ptsHoverAnim); }}; ptsBlock_price_table.prototype._backHoverFont=function($col){ if(_ptsIsEditMode()) return; $col.removeClass('hover'); var $descCell=$col.find('.ptsColDesc'); $descCell.find('span').each(function(){ var prevFontSize=jQuery(this).data('prev-font-size'); if(prevFontSize){ jQuery(this).css('font-size', prevFontSize); }}); setTimeout(function(){ $descCell.outerHeight($descCell.data('prev-height')); }, 300); }; ptsBlock_price_table.prototype._disableHoverEffect=function($cols){ this.setParam('enb_hover_animation', 0); if(_ptsIsEditMode()) return; $cols=$cols ? $cols:this._getCols(); $cols.unbind('hover.animation'); }; ptsBlock_price_table.prototype.getColSelectors=function(){ return { header: {sel: '.ptsColHeader'} , desc: {sel: '.ptsColDesc'} , rows: {sel: '.ptsRows'} , cells: {sel: '.ptsCell'} , footer: {sel: '.ptsColFooter'}};}; ptsBlock_price_table.prototype.getMaxColsSizes=function(widthDesc){ var $cols=this._getCols(widthDesc) , sizes=this.getColSelectors(); $cols.each(function(){ jQuery(this).css({'min-height':'auto'}); for(var key in sizes){ if(key=='rows') continue; var $entity=jQuery(this).find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'){ if(!sizes[ key ].height) sizes[ key ].height=[]; var cellNum=0; $entity.each(function(){ var prevHeight=jQuery(this).outerHeight(); jQuery(this).css('height', 'auto'); var height=jQuery(this).outerHeight(); if(!sizes[ key ].height[ cellNum ]||sizes[ key ].height[ cellNum ] < height){ sizes[ key ].height[ cellNum ]=height; } cellNum++; }); }else{ var prevHeight=$entity.outerHeight(); $entity.css('height', 'auto'); var height=$entity.outerHeight(); if(!sizes[ key ].height||sizes[ key ].height < height){ sizes[ key ].height=height; } $entity.outerHeight(prevHeight); }} }}); return sizes; }; ptsBlock_price_table.prototype.getColumnWithInfo=function(strWidthAttr){ var trimAttr=strWidthAttr.trim(); var number=trimAttr.match('\\d+'); var isPerc=trimAttr.match('%'); var isPx=trimAttr.match('\\d+'); if(number===null||(isPerc===null&&isPx===null)){ return null; } return new Object({ 'num': (number.length&&number.length > 0&&!isNaN(parseInt(number[0]))) ? parseInt(number[0]):null, 'isPerc': isPerc===null ? false:true }); }; ptsBlock_price_table.prototype.setColsWidth=function(width, perc){ var thatObj=this; if(thatObj.getParam('is_horisontal_row_type')!='1'){ if(this.getParam('dsbl_responsive')==='1'){ var tableWidth=this._$.width(), fixedValueTableWidth=this._$.width(), $cols=this._getCols(true), notSettedColumnWidthArr=new Array(); $cols.each(function (){ var col1=jQuery(this); if(col1.length > 0&&col1[0].style&&col1[0].style.width){ var colWidthObj=thatObj.getColumnWithInfo(col1[0].style.width); if(colWidthObj&&'num' in colWidthObj&&'isPerc' in colWidthObj){ var calcColWidth=0; if(colWidthObj.isPerc){ calcColWidth=fixedValueTableWidth * colWidthObj.num / 100; }else{ calcColWidth=colWidthObj.num; } var colPdL=parseFloat(col1.css('padding-left')), colPdR=parseFloat(col1.css('padding-right')), colMgL=parseFloat(col1.css('margin-left')), colMgR=parseFloat(col1.css('margin-right')), colSumMarginPadding=0; if(!isNaN(colPdL)){ colSumMarginPadding +=colPdL; } if(!isNaN(colPdR)){ colSumMarginPadding +=colPdR; } if(!isNaN(colMgL)){ colSumMarginPadding +=colMgL; } if(!isNaN(colMgR)){ colSumMarginPadding +=colMgR; } tableWidth -=calcColWidth; calcColWidth=Math.floor(calcColWidth - colSumMarginPadding); if(calcColWidth < 0){ calcColWidth=0; } col1.width(calcColWidth); }else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}); if(tableWidth > 0&¬SettedColumnWidthArr.length > 0){ var calcWidthForNsCol=Math.round(tableWidth / notSettedColumnWidthArr.length); for (var oneNsColumn in notSettedColumnWidthArr){ notSettedColumnWidthArr[oneNsColumn].width(calcWidthForNsCol); }} }else{ width=parseFloat(width); if(width){ if(!perc){ this.setParam('col_width', width); } var $cols=this._getCols(true); if(perc){ width +='%'; }else{ width +='px'; } $cols.css({ 'width': width }); }} }else{ this.columnChidrensWidthCalc(); }}; ptsBlock_price_table.prototype.columnChidrensWidthCalc=function(){ if(this.getParam('is_horisontal_row_type')!='1'){ return; } var $cols=this._getCols(true); $cols.each(function (ind, oneCol){ var currColumn=jQuery(oneCol) , emptyChilds=currColumn.find('.ptsTableElementContent').children(':not(:has(">div")):not(".ptsColBadge")') , level1Childs=currColumn.find('.ptsTableElementContent').children(':has(">div"):not(".ptsColBadge")') , level1ChildRows=currColumn.find('.ptsTableElementContent').children('.ptsRows') , level2ChildRows=level1ChildRows.children() , allChildCount=level1Childs.length , level2ChildCount=1; if(level1ChildRows.length > 0&&level2ChildRows.length > 0){ allChildCount +=level2ChildRows.length -1; level2ChildCount=level2ChildRows.length; } emptyChilds.css({ 'width': "0%", 'margin': '0', 'padding': '0', }); var oneChildWidth=Math.floor(95 / allChildCount); level1Childs.css('width', oneChildWidth + '%'); var widthInPixel=level1Childs.css('width'); level1ChildRows.css('width', (level2ChildCount*oneChildWidth+2) + '%'); level2ChildRows.css('width', widthInPixel); }); } ptsBlock_price_table.prototype.checkColWidthPerc=function(){ if(this.getParam('calc_width')==='table'){ this.setColWidthPerc(); }}; ptsBlock_price_table.prototype.setColWidthPerc=function(){ var $cols=this._getCols(parseInt(this.getParam('enb_desc_col'))); this.setColsWidth(100 / $cols.size(), true); }; ptsBlock_price_table.prototype.setTableWidth=function(width, measure){ if(width&&parseInt(width)){ width=parseInt(width); this.setParam('table_width', width); }else{ width=this.getParam('table_width'); } if(measure){ this.setParam('table_width_measure', measure); }else{ measure=this.getParam('table_width_measure'); } this._$.width(width+ measure); }; ptsBlock_price_table.prototype.setTableVertPadding=function(padding, measure){ if(padding&&parseInt(padding)){ padding=parseInt(padding); this.setParam('vert_padding', padding); }else{ padding=this.getParam('vert_padding'); } if(measure){ this.setParam('vert_padding_measure', measure); }else{ measure=this.getParam('vert_padding_measure'); } this._$.find('.ptsCol').css('paddingBottom', padding + 'px'); }; ptsBlock_price_table.prototype.setCalcWidth=function(type){ if(type){ this.setParam('calc_width', type); }else{ type=this.getParam('calc_width'); } switch(type){ case 'table': this.setTableWidth(); this.setColWidthPerc(); break; case 'col': var enb_desc_col=this.getParam('enb_desc_col')!=0 ? true:false; this._$.width(this._getCols(enb_desc_col).size() * this.getParam('col_width')); this.setColsWidth(this.getParam('col_width')); break; }}; ptsBlock_price_table.prototype._fixResponsive=function(){ if(this.getParam('is_horisontal_row_type')=='1'){ var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width(); if(jQuery(window).width() < 600){ $parent.addClass('ptsResponcive'); }else{ $parent.removeClass('ptsResponcive'); } return; } var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width() , widthMeasure=this.getParam('table_width_measure') , calcWidth=this.getParam('calc_width') , includeDesc=parseInt(this.getParam('enb_desc_col')) , $cols=this._getCols(includeDesc) , actualTblWidth=this._$.width() , criticalColWidth=isNaN(parseInt(this.getParam('resp_min_col_width'))) ? 150:parseInt(this.getParam('resp_min_col_width')) , dsblResponsive=parseInt(this.getParam('dsbl_responsive')); this._$.removeClass('ptsBlockMobile'); switch(calcWidth){ case 'table': switch(widthMeasure){ case '%': var self=this , removeOtherDescCol=function (){ if(!dsblResponsive && !_ptsIsEditMode() && self._$.find('.ptsTableDescCol').size() > 1 && includeDesc ){ var $descCols=self._$.find('.ptsTableDescCol') , firstCol=false; $descCols.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } $this.remove(); }); }}; $cols=this._getCols(includeDesc); var descColNum=$cols.filter('.ptsTableDescCol').length; var colsNum=$cols.length - (descColNum > 1 ? descColNum - 1:0) , currWidth=actualTblWidth / colsNum; if(currWidth <=criticalColWidth&&!dsblResponsive){ $cols.css('width', '100%'); if(!_ptsIsEditMode()&&includeDesc){ var $descColumn=this._$.find('.ptsTableDescCol').first() , $columns=this._$.find('.ptsCol:not(.ptsTableDescCol)') , firstCol=false; removeOtherDescCol(); var i=0; $columns.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } i++; var $descClone=$descColumn.clone(); $descClone.find('.tooltipstered[data-title]').removeClass('tooltipstered').each(function (){ var el=jQuery(this); el.attr('title', el.attr('data-title')).removeAttr('data-title'); }); $descClone.insertBefore($this); }); this._initTooltipsForCells(); this._isResponsiveDescInit=true; this._$.find('.ptsCol').css('width', '50%'); } this._$.addClass('ptsBlockMobile'); this.setParam('went_to_responsive', 1); }else{ removeOtherDescCol(); if(this.getParam('went_to_responsive')){ this.setColWidthPerc(); this.setParam('went_to_responsive', 0); }} break; case 'px': if(actualTblWidth > parentWidth){ this.setParam('went_to_responsive', this.getParam('table_width')); this.setTableWidth(100, '%'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setTableWidth(this.getParam('went_to_responsive'), 'px'); this.setParam('went_to_responsive', 0); } break; } break; case 'col': var colsNum=$cols.size() , currWidth=parseFloat(this.getParam('col_width')); if(currWidth * colsNum >=parentWidth){ this.setParam('went_to_responsive', currWidth); this.setParam('table_width', 100); this.setParam('table_width_measure', '%'); this.setCalcWidth('table'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setCalcWidth('col'); this.setParam('col_width', this.getParam('went_to_responsive')); this.setParam('went_to_responsive', 0); } break; }}; ptsBlock_price_table.prototype._refreshCellsHeight=function(){ var $cols=this._getCols(true) , self=this , sizes=this.getMaxColsSizes(true); $cols.each(function(){ for(var key in sizes){ var $entity=jQuery(this).find(sizes[ key ].sel); if(self.getParam('is_horisontal_row_type')=='1'){ $entity.css({'height': 'auto'}); }else{ if(key=='rows'){ $entity.css({'height': 'auto'}); continue; } if($entity&&$entity.size()){ if(key=='cells'){ var cellNum=0; $entity.each(function(){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); cellNum++; }); }else{ $entity.outerHeight(sizes[ key ].height); if($entity.outerHeight()!=sizes[ key ].height){ $entity.css('height', sizes[ key ].height); }} }} }}); }; function ptsElementBase(jqueryHtml, block){ this._iterNum=0; this._id='el_'+ mtRand (1, 999999); this._animationSpeed=g_ptsAnimationSpeed; this._$=jqueryHtml; this._block=block; if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId=''; } this._innerImgsCount=0; this._innerImgsLoaded=0; this._menu=null; this._menuClbs={}; if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu'; } this._menuOnBottom=false; this._code='base'; this._initedComplete=false; this._editArea=null; if(typeof(this._isMovable)==='undefined'){ this._isMovable=false; } this._moveHandler=null; this._sortInProgress=false; if(typeof(this._showMenuEvent)==='undefined'){ this._showMenuEvent='click'; } if(typeof(this._changeable)==='undefined'){ this._changeable=false; } if(g_ptsEdit){ this._init(); this._initMenuClbs(); this._initMenu(); var images=this._$.find('img'); if(images&&(this._innerImgsCount=images.size())){ this._innerImgsLoaded=0; var self=this; images.load(function(){ self._innerImgsLoaded++; if(self._$.find('img').size()==self._innerImgsLoaded){ self._afterFullContentLoad(); }}); }} this._onlyFirstHtmlInit(); this._initedComplete=true; } ptsElementBase.prototype.getId=function(){ return this._id; }; ptsElementBase.prototype.getBlock=function(){ return this._block; }; ptsElementBase.prototype._onlyFirstHtmlInit=function(){ if(this._$&&!this._$.data('first-inited')){ this._$.data('first-inited', 1); return true; } return false; }; ptsElementBase.prototype.setIterNum=function(num){ this._iterNum=num; this._$.data('iter-num', num); }; ptsElementBase.prototype.getIterNum=function(){ return this._iterNum; }; ptsElementBase.prototype.$=function(){ return this._$; }; ptsElementBase.prototype.getCode=function(){ return this._code; }; ptsElementBase.prototype._setCode=function(code){ this._code=code; }; ptsElementBase.prototype._init=function(){ this._beforeInit(); }; ptsElementBase.prototype._beforeInit=function(){ }; ptsElementBase.prototype.destroy=function(){ }; ptsElementBase.prototype.get=function(opt){ return jQuery('
').html(this._$.attr('data-'+ opt)).text(); }; ptsElementBase.prototype.set=function(opt, val){ this._$.attr('data-'+ opt, jQuery('
').text(val).html()); }; ptsElementBase.prototype._getEditArea=function(){ if(!this._editArea){ this._editArea=this._$.children('.ptsElArea'); if(!this._editArea.size()){ this._editArea=this._$.find('.ptsInputShell'); }} return this._editArea; }; ptsElementBase.prototype._getOverlay=function(){ return this._$.find('.ptsElOverlay'); }; function ptsElement_btn(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuBtnExl'; } this._menuClass='ptsElementMenu_btn'; this._haveAdditionBgEl=null; this._changeable=true; this.includePostLinks=true; ptsElement_btn.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_btn, ptsElementBase); ptsElement_btn.prototype._onlyFirstHtmlInit=function(){ if(ptsElement_btn.superclass._onlyFirstHtmlInit.apply(this, arguments)){ if(this.get('customhover-clb')){ var clbName=this.get('customhover-clb'); if(typeof(this[clbName])==='function'){ var self=this; this._getEditArea().hover(function(){ self[clbName](true, this); }, function(){ self[clbName](false, this); }); }} }}; ptsElement_btn.prototype._hoverChangeFontColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', this._getEditArea().css('color')) .css('color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('color', jQuery(element).data('original-color')); }}; ptsElement_btn.prototype._hoverChangeBgColor=function(hover, element){ var parentElement=jQuery(element).parents('.ptsEl:first'); if(hover){ parentElement .data('original-color', parentElement.css('background-color')) .css('background-color', parentElement.attr('data-bgcolor')); }else{ parentElement .css('background-color', parentElement.data('original-color')); }}; ptsElement_btn.prototype._hoverBorderColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', jQuery(element).css('border-color')) .css('border-color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('border-color', jQuery(element).data('original-color')); }}; function ptsElement_table_col(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuTableColExl'; } if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu_table_col'; } if(typeof(this._isMovable)==='undefined'){ this._isMovable=true; } this._showMenuEvent='hover'; this._colNum=0; ptsElement_table_col.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_col, ptsElementBase); ptsElement_table_col.prototype.setIterNum=function(){ ptsElement_table_col.superclass.setIterNum.apply(this, arguments); if(!g_ptsEdit&&typeof(ptsScheduleCheck)!=='undefined'){ ptsScheduleCheck(this); }}; function ptsElement_table_col_desc(jqueryHtml, block){ this._isMovable=false; ptsElement_table_col_desc.superclass.constructor.apply(this, arguments); /*this.getBlock().$().bind('ptsBlockContentChanged', function(){ self.refreshHeight(); });*/ } extendPts(ptsElement_table_col_desc, ptsElement_table_col); /*ptsElement_table_col_desc.prototype.refreshHeight=function(){ var sizes=this.getBlock().getMaxColsSizes(); for(var key in sizes){ var $entity=this._$.find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'&&sizes[ key ].height){ var cellNum=0; $entity.each(function(){ if(typeof(sizes[ key ].height[ cellNum ])!=='undefined'){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); } cellNum++; }); }else{ $entity.css('height', sizes[ key ].height); }} }};*/ function ptsElement_table_cell_txt(jqueryHtml, block){ if(block.getParam('responsive_text')){ jqueryHtml.find('span, p').responsiveText({ minFontSize: 14 }); } this.includePostLinks=true; ptsElement_table_cell_txt.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_cell_txt, ptsElementBase); (function ($){ 'use strict'; $.fn.sModal=function(options){ var self=this, settings=$.extend({ width: 640, height: 480, buttons: [], }, options), $modalOverlay, $modalContainer, $closeModalButton, $modalContent, $modalButtons, modalOverlayStyle={ position: 'fixed', top: 0, left: 0, background: 'rgba(0,0,0,.75)', width: '100%', height: '100%', 'z-index': '100000', display: 'none', 'overflow-y': 'auto', }, modalContainerStyle={ width: settings.width, position: 'absolute', top: '50%', left: '50%', 'max-width': 'calc(100% - 1.5em)', 'margin-right': '-50%', 'margin-bottom': '20px', transform: 'translate(-50%, -50%)', background: '#fff', padding: '1em', }, modalContentStyle={ height: 'calc(100% - 3.6em)', 'overflow-y': 'auto', 'overflow-x': 'hidden', padding: '1em', }, closeButtonStyle={ position: 'absolute', right: '10px', top: '10px', 'font-size': '35px', color: '#fff', cursor: 'pointer', }, modalButtonsStyle={ position: 'relative', width: '100%', 'text-align': 'right', 'margin-top': '1em', }; function closeModal(){ self.trigger('close.before'); if(jQuery('.sModal:visible').length < 2){ jQuery('body').css('overflow', 'auto'); } $modalOverlay.fadeOut(); self.trigger('close.after'); } function openModal(){ jQuery('body').css('overflow', 'hidden'); $modalOverlay.show(0, function(){ resizeModal(); $modalOverlay.hide().fadeIn(); }); if(parseInt(jQuery('.sc-modal-container').css('top')) > jQuery(window).height()){ var offset=jQuery(window).height() / 2 + 40; jQuery('.sc-modal-container').css('top' , offset); }} function resizeModal(){ var offset='50%'; if($modalContainer.height() > jQuery(window).height()){ offset=$modalContainer.height() / 2 + 40; } $modalContainer.css('top', offset); } function createInstance($modalTemplate){ $modalOverlay=jQuery('
').css(modalOverlayStyle); $modalContainer=jQuery('
').css(modalContainerStyle); $closeModalButton=jQuery('
×
').css(closeButtonStyle); $closeModalButton.appendTo($modalOverlay); $modalContent=jQuery('
').css(modalContentStyle); $modalContent.appendTo($modalContainer); $modalTemplate.appendTo($modalContent).show(); $modalContainer.appendTo($modalOverlay); $modalOverlay.appendTo('body'); $modalOverlay.add($closeModalButton).on('click', function(event){ if(jQuery(this).is(jQuery(event.target))){ closeModal(); }}); jQuery(document).on('keyup', function(event){ if(event.which==27&&$modalOverlay.is(':visible')){ closeModal(); }}); var resizeTimer; jQuery(window).on('resize', function(event){ clearTimeout(resizeTimer); resizeTimer=setTimeout(function(){ resizeModal(); }, 250); }); if(settings.buttons.length > 0){ $modalButtons=jQuery('
').css(modalButtonsStyle); for (var i=0; i < settings.buttons.length; i++){ jQuery('